## Start:  AIC=-2358.71
## gaba ~ MBP + TdTomato + DAPI1 + DAPI2 + DAPI3 + GluN1 + PSD95 + 
##     synapsin + VGlut1 + GABA + GAD2 + Gephyrin
## 
##            Df Sum of Sq    RSS     AIC
## - DAPI2     1    0.0230 39.221 -2360.2
## - DAPI3     1    0.0361 39.234 -2360.0
## - MBP       1    0.0392 39.237 -2359.9
## - DAPI1     1    0.0404 39.238 -2359.9
## <none>                  39.198 -2358.7
## - GluN1     1    0.1676 39.365 -2357.3
## - TdTomato  1    0.3268 39.525 -2354.1
## - VGlut1    1    0.4278 39.626 -2352.1
## - GAD2      1    0.6291 39.827 -2348.1
## - synapsin  1    1.4834 40.681 -2331.2
## - PSD95     1    1.7254 40.923 -2326.6
## - Gephyrin  1    1.9041 41.102 -2323.1
## - GABA      1    7.7406 46.938 -2217.8
## 
## Step:  AIC=-2360.25
## gaba ~ MBP + TdTomato + DAPI1 + DAPI3 + GluN1 + PSD95 + synapsin + 
##     VGlut1 + GABA + GAD2 + Gephyrin
## 
##            Df Sum of Sq    RSS     AIC
## - DAPI3     1    0.0312 39.252 -2361.6
## - DAPI1     1    0.0350 39.256 -2361.5
## - MBP       1    0.0366 39.257 -2361.5
## <none>                  39.221 -2360.2
## - GluN1     1    0.2800 39.501 -2356.6
## - TdTomato  1    0.3547 39.576 -2355.1
## - VGlut1    1    0.4583 39.679 -2353.0
## - GAD2      1    0.6159 39.837 -2349.9
## - synapsin  1    1.5572 40.778 -2331.4
## - PSD95     1    1.7025 40.923 -2328.6
## - Gephyrin  1    1.9098 41.131 -2324.5
## - GABA      1    8.2289 47.450 -2211.2
## 
## Step:  AIC=-2361.62
## gaba ~ MBP + TdTomato + DAPI1 + GluN1 + PSD95 + synapsin + VGlut1 + 
##     GABA + GAD2 + Gephyrin
## 
##            Df Sum of Sq    RSS     AIC
## - MBP       1    0.0132 39.265 -2363.3
## - DAPI1     1    0.0416 39.294 -2362.8
## <none>                  39.252 -2361.6
## - GluN1     1    0.2560 39.508 -2358.5
## - TdTomato  1    0.3696 39.622 -2356.2
## - VGlut1    1    0.4596 39.712 -2354.4
## - GAD2      1    0.5954 39.847 -2351.7
## - synapsin  1    1.5831 40.835 -2332.3
## - PSD95     1    1.6744 40.926 -2330.5
## - Gephyrin  1    1.9575 41.209 -2325.0
## - GABA      1   10.4930 49.745 -2175.8
## 
## Step:  AIC=-2363.35
## gaba ~ TdTomato + DAPI1 + GluN1 + PSD95 + synapsin + VGlut1 + 
##     GABA + GAD2 + Gephyrin
## 
##            Df Sum of Sq    RSS     AIC
## - DAPI1     1    0.0420 39.307 -2364.5
## <none>                  39.265 -2363.3
## - GluN1     1    0.2625 39.528 -2360.1
## - TdTomato  1    0.3690 39.634 -2357.9
## - VGlut1    1    0.4539 39.719 -2356.2
## - GAD2      1    0.6124 39.878 -2353.1
## - synapsin  1    1.5796 40.845 -2334.1
## - PSD95     1    1.6655 40.931 -2332.4
## - Gephyrin  1    1.9648 41.230 -2326.6
## - GABA      1   10.4806 49.746 -2177.7
## 
## Step:  AIC=-2364.5
## gaba ~ TdTomato + GluN1 + PSD95 + synapsin + VGlut1 + GABA + 
##     GAD2 + Gephyrin
## 
##            Df Sum of Sq    RSS     AIC
## <none>                  39.307 -2364.5
## - GluN1     1    0.3166 39.624 -2360.1
## - TdTomato  1    0.3615 39.669 -2359.2
## - VGlut1    1    0.5043 39.812 -2356.4
## - GAD2      1    0.6551 39.962 -2353.4
## - synapsin  1    1.5402 40.847 -2336.0
## - PSD95     1    1.7363 41.044 -2332.2
## - Gephyrin  1    2.1129 41.420 -2325.0
## - GABA      1   10.4904 49.798 -2178.9
## 
## Call:
## lm(formula = gaba ~ TdTomato + GluN1 + PSD95 + synapsin + VGlut1 + 
##     GABA + GAD2 + Gephyrin, data = sdat)
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -1.53487 -0.08879 -0.04081  0.02644  0.93385 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept)  0.107188   0.007951  13.480  < 2e-16 ***
## TdTomato    -0.022543   0.008395  -2.685  0.00740 ** 
## GluN1       -0.024721   0.009837  -2.513  0.01217 *  
## PSD95       -0.055816   0.009485  -5.885 5.90e-09 ***
## synapsin    -0.051453   0.009283  -5.543 4.07e-08 ***
## VGlut1      -0.031204   0.009838  -3.172  0.00157 ** 
## GABA         0.162002   0.011200  14.465  < 2e-16 ***
## GAD2         0.040866   0.011305   3.615  0.00032 ***
## Gephyrin     0.056079   0.008639   6.492 1.50e-10 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.2239 on 784 degrees of freedom
## Multiple R-squared:  0.482,  Adjusted R-squared:  0.4768 
## F-statistic:  91.2 on 8 and 784 DF,  p-value: < 2.2e-16

1 Results

1.1 1-d Heatmap

1.2 Location meda_plots

1.3 Outliers as given by randomForest

1.4 Correlation Matrix

1.5 Cumulative Variance with Elbows

1.6 Paired Hex-binned plot

1.7 Hierarchical GMM Classifications

1.8 Hierarchical GMM Dendrogram

1.9 Stacked Means

1.10 Cluster Means

2 Restricting hGMM to \(K = 2\)

Here we are restricting hierarchical GMM to only go through on level. We are comparing the cluster results to the gaba labels.

set.seed(3144)
h2 <- hmc(sdat[, -1], maxDepth = 2, ccol = ccol, model = c("VVV"))
h2lab <- viridis(max(h2$dat$labels$col))
h2col <- h2$dat$labels$col

2.1 K = 2 stacked means plot

p1 <- stackM(h2, ccol = ccol, centered = TRUE, depth = 1)
p1

2.2 Pairs plot colored by true gaba classification

cols <- c("black", "magenta")[gabaID$gaba+1]
acols <- alpha(cols, 0.35)
#pairs(h2$dat$data, pch = 19, cex = 0.7, col = acols)
#plot(h2$dat$data, col = acols, pch = c(19,3)[gaba+1], cex = c(0.5,1)[gaba+1])
pairs(sdat[,-1], col = acols, pch = c(19,3)[gaba+1], cex = c(0.5,1)[gaba+1])

2.3 Pairs plot colored by hGMM cluster classification

acols2 <- alpha(h2lab[h2$dat$labels$col], 0.45)
par(bg = "gray45")
#plot(h2$dat$data, pch = c(3,20)[gaba + 1], cex = 1, col = acols2)
pairs(sdat[,-1], pch = 19, cex = 0.7, col = acols2)

dev.off()
## null device 
##           1

3 Permutation test for ARI

p0 <- mclust::adjustedRandIndex(pred, gaba)
perms <- foreach(i = 1:1.5e4, .combine = c) %dopar% {
  set.seed(i*2)
  mclust::adjustedRandIndex(sample(pred), gaba)
}
pv0 <- sum(c(perms,p0) >= p0)/length(perms)
hist(perms, xlim = c(min(perms), p0 + 0.25*p0),
     main = "permutation test of ARI values", probability = TRUE)
#hist(perms, probability = TRUE)
abline(v = p0, col = 'red')

t1
##        truth
## pred    FALSE TRUE
##   FALSE   590    9
##   TRUE    118   76

4 Summary Table

measurment value
Misclassification Rate 0.1601513
Accuracy 0.8398487
Sensitivity 0.8941176
Specificity 0.8333333
Precision 0.3917526
Recall 0.8941176
ARI 0.3584828
\(p\)-value for ARI 0.000067
F1-score 0.5448029
TP 76
FP 118
TN 590
FN 9